Integrand size = 21, antiderivative size = 81 \[ \int \frac {\cot ^2(c+d x)}{a+b \tan (c+d x)} \, dx=-\frac {a x}{a^2+b^2}-\frac {\cot (c+d x)}{a d}-\frac {b \log (\sin (c+d x))}{a^2 d}+\frac {b^3 \log (a \cos (c+d x)+b \sin (c+d x))}{a^2 \left (a^2+b^2\right ) d} \]
-a*x/(a^2+b^2)-cot(d*x+c)/a/d-b*ln(sin(d*x+c))/a^2/d+b^3*ln(a*cos(d*x+c)+b *sin(d*x+c))/a^2/(a^2+b^2)/d
Result contains complex when optimal does not.
Time = 0.49 (sec) , antiderivative size = 96, normalized size of antiderivative = 1.19 \[ \int \frac {\cot ^2(c+d x)}{a+b \tan (c+d x)} \, dx=-\frac {\frac {\cot (c+d x)}{a}-\frac {\log (i-\cot (c+d x))}{2 (i a+b)}+\frac {\log (i+\cot (c+d x))}{2 (i a-b)}-\frac {b^3 \log (b+a \cot (c+d x))}{a^2 \left (a^2+b^2\right )}}{d} \]
-((Cot[c + d*x]/a - Log[I - Cot[c + d*x]]/(2*(I*a + b)) + Log[I + Cot[c + d*x]]/(2*(I*a - b)) - (b^3*Log[b + a*Cot[c + d*x]])/(a^2*(a^2 + b^2)))/d)
Time = 0.59 (sec) , antiderivative size = 90, normalized size of antiderivative = 1.11, number of steps used = 8, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.381, Rules used = {3042, 4052, 3042, 4134, 3042, 25, 3956, 4013}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \frac {\cot ^2(c+d x)}{a+b \tan (c+d x)} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {1}{\tan (c+d x)^2 (a+b \tan (c+d x))}dx\) |
\(\Big \downarrow \) 4052 |
\(\displaystyle -\frac {\int \frac {\cot (c+d x) \left (b \tan ^2(c+d x)+a \tan (c+d x)+b\right )}{a+b \tan (c+d x)}dx}{a}-\frac {\cot (c+d x)}{a d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle -\frac {\int \frac {b \tan (c+d x)^2+a \tan (c+d x)+b}{\tan (c+d x) (a+b \tan (c+d x))}dx}{a}-\frac {\cot (c+d x)}{a d}\) |
\(\Big \downarrow \) 4134 |
\(\displaystyle -\frac {-\frac {b^3 \int \frac {b-a \tan (c+d x)}{a+b \tan (c+d x)}dx}{a \left (a^2+b^2\right )}+\frac {b \int \cot (c+d x)dx}{a}+\frac {a^2 x}{a^2+b^2}}{a}-\frac {\cot (c+d x)}{a d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle -\frac {-\frac {b^3 \int \frac {b-a \tan (c+d x)}{a+b \tan (c+d x)}dx}{a \left (a^2+b^2\right )}+\frac {b \int -\tan \left (c+d x+\frac {\pi }{2}\right )dx}{a}+\frac {a^2 x}{a^2+b^2}}{a}-\frac {\cot (c+d x)}{a d}\) |
\(\Big \downarrow \) 25 |
\(\displaystyle -\frac {-\frac {b^3 \int \frac {b-a \tan (c+d x)}{a+b \tan (c+d x)}dx}{a \left (a^2+b^2\right )}-\frac {b \int \tan \left (\frac {1}{2} (2 c+\pi )+d x\right )dx}{a}+\frac {a^2 x}{a^2+b^2}}{a}-\frac {\cot (c+d x)}{a d}\) |
\(\Big \downarrow \) 3956 |
\(\displaystyle -\frac {-\frac {b^3 \int \frac {b-a \tan (c+d x)}{a+b \tan (c+d x)}dx}{a \left (a^2+b^2\right )}+\frac {a^2 x}{a^2+b^2}+\frac {b \log (-\sin (c+d x))}{a d}}{a}-\frac {\cot (c+d x)}{a d}\) |
\(\Big \downarrow \) 4013 |
\(\displaystyle -\frac {\frac {a^2 x}{a^2+b^2}-\frac {b^3 \log (a \cos (c+d x)+b \sin (c+d x))}{a d \left (a^2+b^2\right )}+\frac {b \log (-\sin (c+d x))}{a d}}{a}-\frac {\cot (c+d x)}{a d}\) |
-(Cot[c + d*x]/(a*d)) - ((a^2*x)/(a^2 + b^2) + (b*Log[-Sin[c + d*x]])/(a*d ) - (b^3*Log[a*Cos[c + d*x] + b*Sin[c + d*x]])/(a*(a^2 + b^2)*d))/a
3.5.64.3.1 Defintions of rubi rules used
Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Log[RemoveContent[Cos[c + d *x], x]]/d, x] /; FreeQ[{c, d}, x]
Int[((c_) + (d_.)*tan[(e_.) + (f_.)*(x_)])/((a_) + (b_.)*tan[(e_.) + (f_.)* (x_)]), x_Symbol] :> Simp[(c/(b*f))*Log[RemoveContent[a*Cos[e + f*x] + b*Si n[e + f*x], x]], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && EqQ[a*c + b*d, 0]
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[b^2*(a + b*Tan[e + f*x])^(m + 1)*((c + d*Tan[e + f*x])^(n + 1)/(f*(m + 1)*(a^2 + b^2)*(b*c - a*d))), x] + Simp[1 /((m + 1)*(a^2 + b^2)*(b*c - a*d)) Int[(a + b*Tan[e + f*x])^(m + 1)*(c + d*Tan[e + f*x])^n*Simp[a*(b*c - a*d)*(m + 1) - b^2*d*(m + n + 2) - b*(b*c - a*d)*(m + 1)*Tan[e + f*x] - b^2*d*(m + n + 2)*Tan[e + f*x]^2, x], x], x] / ; FreeQ[{a, b, c, d, e, f, n}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && NeQ[c^2 + d^2, 0] && IntegerQ[2*m] && LtQ[m, -1] && (LtQ[n, 0] || Integ erQ[m]) && !(ILtQ[n, -1] && ( !IntegerQ[m] || (EqQ[c, 0] && NeQ[a, 0])))
Int[((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)] + (C_.)*tan[(e_.) + (f_.)*(x_)]^ 2)/(((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f_.) *(x_)])), x_Symbol] :> Simp[(a*(A*c - c*C + B*d) + b*(B*c - A*d + C*d))*(x/ ((a^2 + b^2)*(c^2 + d^2))), x] + (Simp[(A*b^2 - a*b*B + a^2*C)/((b*c - a*d) *(a^2 + b^2)) Int[(b - a*Tan[e + f*x])/(a + b*Tan[e + f*x]), x], x] - Sim p[(c^2*C - B*c*d + A*d^2)/((b*c - a*d)*(c^2 + d^2)) Int[(d - c*Tan[e + f* x])/(c + d*Tan[e + f*x]), x], x]) /; FreeQ[{a, b, c, d, e, f, A, B, C}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && NeQ[c^2 + d^2, 0]
Time = 0.53 (sec) , antiderivative size = 94, normalized size of antiderivative = 1.16
method | result | size |
derivativedivides | \(\frac {\frac {b^{3} \ln \left (a +b \tan \left (d x +c \right )\right )}{a^{2} \left (a^{2}+b^{2}\right )}-\frac {1}{a \tan \left (d x +c \right )}-\frac {b \ln \left (\tan \left (d x +c \right )\right )}{a^{2}}+\frac {\frac {b \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2}-a \arctan \left (\tan \left (d x +c \right )\right )}{a^{2}+b^{2}}}{d}\) | \(94\) |
default | \(\frac {\frac {b^{3} \ln \left (a +b \tan \left (d x +c \right )\right )}{a^{2} \left (a^{2}+b^{2}\right )}-\frac {1}{a \tan \left (d x +c \right )}-\frac {b \ln \left (\tan \left (d x +c \right )\right )}{a^{2}}+\frac {\frac {b \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2}-a \arctan \left (\tan \left (d x +c \right )\right )}{a^{2}+b^{2}}}{d}\) | \(94\) |
parallelrisch | \(\frac {-2 a^{3} d x +2 b^{3} \ln \left (a +b \tan \left (d x +c \right )\right )-2 a^{2} b \ln \left (\tan \left (d x +c \right )\right )-2 \ln \left (\tan \left (d x +c \right )\right ) b^{3}+\ln \left (\sec ^{2}\left (d x +c \right )\right ) a^{2} b -2 a^{3} \cot \left (d x +c \right )-2 \cot \left (d x +c \right ) a \,b^{2}}{2 a^{2} d \left (a^{2}+b^{2}\right )}\) | \(104\) |
norman | \(\frac {-\frac {1}{a d}-\frac {a x \tan \left (d x +c \right )}{a^{2}+b^{2}}}{\tan \left (d x +c \right )}+\frac {b^{3} \ln \left (a +b \tan \left (d x +c \right )\right )}{a^{2} d \left (a^{2}+b^{2}\right )}-\frac {b \ln \left (\tan \left (d x +c \right )\right )}{a^{2} d}+\frac {b \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2 d \left (a^{2}+b^{2}\right )}\) | \(111\) |
risch | \(\frac {x}{i b -a}+\frac {2 i b x}{a^{2}}+\frac {2 i b c}{a^{2} d}-\frac {2 i b^{3} x}{a^{2} \left (a^{2}+b^{2}\right )}-\frac {2 i b^{3} c}{a^{2} d \left (a^{2}+b^{2}\right )}-\frac {2 i}{d a \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )}-\frac {b \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )}{a^{2} d}+\frac {b^{3} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-\frac {i b +a}{i b -a}\right )}{a^{2} d \left (a^{2}+b^{2}\right )}\) | \(165\) |
1/d*(1/a^2*b^3/(a^2+b^2)*ln(a+b*tan(d*x+c))-1/a/tan(d*x+c)-1/a^2*b*ln(tan( d*x+c))+1/(a^2+b^2)*(1/2*b*ln(1+tan(d*x+c)^2)-a*arctan(tan(d*x+c))))
Time = 0.26 (sec) , antiderivative size = 140, normalized size of antiderivative = 1.73 \[ \int \frac {\cot ^2(c+d x)}{a+b \tan (c+d x)} \, dx=-\frac {2 \, a^{3} d x \tan \left (d x + c\right ) - b^{3} \log \left (\frac {b^{2} \tan \left (d x + c\right )^{2} + 2 \, a b \tan \left (d x + c\right ) + a^{2}}{\tan \left (d x + c\right )^{2} + 1}\right ) \tan \left (d x + c\right ) + 2 \, a^{3} + 2 \, a b^{2} + {\left (a^{2} b + b^{3}\right )} \log \left (\frac {\tan \left (d x + c\right )^{2}}{\tan \left (d x + c\right )^{2} + 1}\right ) \tan \left (d x + c\right )}{2 \, {\left (a^{4} + a^{2} b^{2}\right )} d \tan \left (d x + c\right )} \]
-1/2*(2*a^3*d*x*tan(d*x + c) - b^3*log((b^2*tan(d*x + c)^2 + 2*a*b*tan(d*x + c) + a^2)/(tan(d*x + c)^2 + 1))*tan(d*x + c) + 2*a^3 + 2*a*b^2 + (a^2*b + b^3)*log(tan(d*x + c)^2/(tan(d*x + c)^2 + 1))*tan(d*x + c))/((a^4 + a^2 *b^2)*d*tan(d*x + c))
Result contains complex when optimal does not.
Time = 1.47 (sec) , antiderivative size = 1080, normalized size of antiderivative = 13.33 \[ \int \frac {\cot ^2(c+d x)}{a+b \tan (c+d x)} \, dx=\text {Too large to display} \]
Piecewise((zoo*x, Eq(a, 0) & Eq(b, 0) & Eq(c, 0) & Eq(d, 0)), ((-x - cot(c + d*x)/d)/a, Eq(b, 0)), ((log(tan(c + d*x)**2 + 1)/(2*d) - log(tan(c + d* x))/d - 1/(2*d*tan(c + d*x)**2))/b, Eq(a, 0)), (-3*d*x*tan(c + d*x)**2/(2* a*d*tan(c + d*x)**2 + 2*I*a*d*tan(c + d*x)) - 3*I*d*x*tan(c + d*x)/(2*a*d* tan(c + d*x)**2 + 2*I*a*d*tan(c + d*x)) - I*log(tan(c + d*x)**2 + 1)*tan(c + d*x)**2/(2*a*d*tan(c + d*x)**2 + 2*I*a*d*tan(c + d*x)) + log(tan(c + d* x)**2 + 1)*tan(c + d*x)/(2*a*d*tan(c + d*x)**2 + 2*I*a*d*tan(c + d*x)) + 2 *I*log(tan(c + d*x))*tan(c + d*x)**2/(2*a*d*tan(c + d*x)**2 + 2*I*a*d*tan( c + d*x)) - 2*log(tan(c + d*x))*tan(c + d*x)/(2*a*d*tan(c + d*x)**2 + 2*I* a*d*tan(c + d*x)) - 3*tan(c + d*x)/(2*a*d*tan(c + d*x)**2 + 2*I*a*d*tan(c + d*x)) - 2*I/(2*a*d*tan(c + d*x)**2 + 2*I*a*d*tan(c + d*x)), Eq(b, -I*a)) , (-3*d*x*tan(c + d*x)**2/(2*a*d*tan(c + d*x)**2 - 2*I*a*d*tan(c + d*x)) + 3*I*d*x*tan(c + d*x)/(2*a*d*tan(c + d*x)**2 - 2*I*a*d*tan(c + d*x)) + I*l og(tan(c + d*x)**2 + 1)*tan(c + d*x)**2/(2*a*d*tan(c + d*x)**2 - 2*I*a*d*t an(c + d*x)) + log(tan(c + d*x)**2 + 1)*tan(c + d*x)/(2*a*d*tan(c + d*x)** 2 - 2*I*a*d*tan(c + d*x)) - 2*I*log(tan(c + d*x))*tan(c + d*x)**2/(2*a*d*t an(c + d*x)**2 - 2*I*a*d*tan(c + d*x)) - 2*log(tan(c + d*x))*tan(c + d*x)/ (2*a*d*tan(c + d*x)**2 - 2*I*a*d*tan(c + d*x)) - 3*tan(c + d*x)/(2*a*d*tan (c + d*x)**2 - 2*I*a*d*tan(c + d*x)) + 2*I/(2*a*d*tan(c + d*x)**2 - 2*I*a* d*tan(c + d*x)), Eq(b, I*a)), (zoo*x/a, Eq(c, -d*x)), (x*cot(c)**2/(a +...
Time = 0.38 (sec) , antiderivative size = 100, normalized size of antiderivative = 1.23 \[ \int \frac {\cot ^2(c+d x)}{a+b \tan (c+d x)} \, dx=\frac {\frac {2 \, b^{3} \log \left (b \tan \left (d x + c\right ) + a\right )}{a^{4} + a^{2} b^{2}} - \frac {2 \, {\left (d x + c\right )} a}{a^{2} + b^{2}} + \frac {b \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{a^{2} + b^{2}} - \frac {2 \, b \log \left (\tan \left (d x + c\right )\right )}{a^{2}} - \frac {2}{a \tan \left (d x + c\right )}}{2 \, d} \]
1/2*(2*b^3*log(b*tan(d*x + c) + a)/(a^4 + a^2*b^2) - 2*(d*x + c)*a/(a^2 + b^2) + b*log(tan(d*x + c)^2 + 1)/(a^2 + b^2) - 2*b*log(tan(d*x + c))/a^2 - 2/(a*tan(d*x + c)))/d
Time = 0.50 (sec) , antiderivative size = 116, normalized size of antiderivative = 1.43 \[ \int \frac {\cot ^2(c+d x)}{a+b \tan (c+d x)} \, dx=\frac {\frac {2 \, b^{4} \log \left ({\left | b \tan \left (d x + c\right ) + a \right |}\right )}{a^{4} b + a^{2} b^{3}} - \frac {2 \, {\left (d x + c\right )} a}{a^{2} + b^{2}} + \frac {b \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{a^{2} + b^{2}} - \frac {2 \, b \log \left ({\left | \tan \left (d x + c\right ) \right |}\right )}{a^{2}} + \frac {2 \, {\left (b \tan \left (d x + c\right ) - a\right )}}{a^{2} \tan \left (d x + c\right )}}{2 \, d} \]
1/2*(2*b^4*log(abs(b*tan(d*x + c) + a))/(a^4*b + a^2*b^3) - 2*(d*x + c)*a/ (a^2 + b^2) + b*log(tan(d*x + c)^2 + 1)/(a^2 + b^2) - 2*b*log(abs(tan(d*x + c)))/a^2 + 2*(b*tan(d*x + c) - a)/(a^2*tan(d*x + c)))/d
Time = 5.13 (sec) , antiderivative size = 108, normalized size of antiderivative = 1.33 \[ \int \frac {\cot ^2(c+d x)}{a+b \tan (c+d x)} \, dx=\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )+1{}\mathrm {i}\right )}{2\,d\,\left (b+a\,1{}\mathrm {i}\right )}-\frac {\mathrm {cot}\left (c+d\,x\right )}{a\,d}-\frac {b\,\ln \left (\mathrm {tan}\left (c+d\,x\right )\right )}{a^2\,d}+\frac {b^3\,\ln \left (a+b\,\mathrm {tan}\left (c+d\,x\right )\right )}{a^2\,d\,\left (a^2+b^2\right )}+\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )-\mathrm {i}\right )\,1{}\mathrm {i}}{2\,d\,\left (a+b\,1{}\mathrm {i}\right )} \]